export interface MappingField {
  id: string
  name: string
  type: string
  index?: boolean
  store?: boolean
  analyzer?: string
  fields?: MappingField[]
  properties?: MappingField[]
}


export interface FieldItemProps {
  field: MappingField
  onUpdate: (id: string, updates: Partial<MappingField>) => void
  onDelete: (id: string) => void
  level?: number
}

export const FIELD_TYPES = [
  { label: "文本 (text)", value: "text" },
  { label: "关键字 (keyword)", value: "keyword" },
  { label: "长整型 (long)", value: "long" },
  { label: "整型 (integer)", value: "integer" },
  { label: "短整型 (short)", value: "short" },
  { label: "字节 (byte)", value: "byte" },
  { label: "双精度 (double)", value: "double" },
  { label: "浮点型 (float)", value: "float" },
  { label: "日期 (date)", value: "date" },
  { label: "布尔 (boolean)", value: "boolean" },
  { label: "二进制 (binary)", value: "binary" },
  { label: "对象 (object)", value: "object" },
  { label: "嵌套 (nested)", value: "nested" },
  { label: "地理坐标 (geo_point)", value: "geo_point" },
  { label: "地理形状 (geo_shape)", value: "geo_shape" },
  { label: "IP地址 (ip)", value: "ip" },
]

export const ANALYZERS = [
  { label: "标准分析器 (standard)", value: "standard" },
  { label: "简单分析器 (simple)", value: "simple" },
  { label: "空格分析器 (whitespace)", value: "whitespace" },
  { label: "停用词分析器 (stop)", value: "stop" },
  { label: "关键字分析器 (keyword)", value: "keyword" },
  { label: "模式分析器 (pattern)", value: "pattern" },
]